package com.ymatou.iapi.m.couponservice.service;

import org.json.JSONObject;

import com.ymatou.iapi.m.couponservice.parameter.SellerReceiveBatches;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
/**
*获取商家可以领取的批次列表Call
*FreeMaker Template自动生成代码
*/
public class GetSellerReceiveBatchesCall extends YmatouBaseCall{
	private static String opurl ="api/SellerManage/GetSellerReceiveBatches";
	
	public GetSellerReceiveBatchesCall() {
		super(EnvSetup.getSystemUrl("couponservice_m"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	/**
	 * 获取Code
	 * 
	 * @return
	 */
	public String getCode() {
		return getString("statusCode");		
	}

	/**
	 * 获取Message
	 * 
	 * @return
	 */
	public String getMessage() {
		return getString("message");	
	}

	/**
	 * 获取Data
	 * 
	 * @return
	 */
	public String getData() {
		return getString("data");	
	}

	public SellerReceiveBatches getBatchInfos() {
		SellerReceiveBatches data = null;
        try {
            data = (SellerReceiveBatches) FormatUtil.GSONToObject(getData().toString(), SellerReceiveBatches.class);
        } catch (Exception e) {
            e.printStackTrace();
        }
		return data;
	}
}